import type { RouteRecordRaw } from 'vue-router'

import { NAME_STARTUP } from '../constants'

import Home from '@/pages/home/index.vue'

export const AppRoutes: RouteRecordRaw[] = markRaw([
  {
    path: '/',
    name: 'home',
    component: Home,
    redirect: '/form',
    meta: {
      transition: 'blur'
    },
    children: [
      {
        path: 'form',
        name: 'form',
        meta: {
          step: 0
        },
        component: () => import('@/pages/home/components/Form.vue')
      },
      {
        path: 'tree',
        name: 'tree',
        meta: {
          step: 1
        },
        component: () => import('@/pages/home/components/Tree.vue')
      },
      {
        path: 'done',
        name: 'done',
        meta: {
          step: 2
        },
        component: () => import('@/pages/home/components/Done.vue')
      }
    ]
  },
  {
    path: `/${NAME_STARTUP}`,
    name: NAME_STARTUP,
    meta: {
      transition: 'blur',
      label: '起始页'
    },
    component: () => import('@/pages/startup/index.vue'),
    children: []
  }
])
